package org.example.demo3.spring;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component("zhangsan")
@Data
public class Human {
    @Value("zhangsan")  //@Value只适合普通数据类型
    String name;
    @Autowired
    @Qualifier("hanxuebaoma") //标识注入的对象名称
    List<Car> cars;
    //人与人之间的关系
    Map<String,Human> relatives;
}
